﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Http;
using System.Web.UI.WebControls;
using InformationCenter.Controllers;

namespace InformationCenter
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            // 在应用程序启动时运行的代码
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);            
        }

        protected void Application_PostAuthenticateRequest(object sender, EventArgs e)
        {
            var identity = HttpContext.Current.User.Identity as FormsIdentity;
            if (identity != null)
            {
                //登录成功后,可以写点处理,赋值角色什么的,也可以留空
            }
        }
    }
}